<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>PO Format Details</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>

<h2>Bundle and File Names</h2>
<p>Resources can be imported from GNU gettext formatted PO files either individually or as a zip archive. The names of the PO files inside the zip are used to determine the bundle names and languages of the resources they contain. If uploading individually, a random bundle name will be generated. To upload to a specific bundle, create a folder for that bundle inside the archive.</p>
<p><strong>For example:</strong> In an archive structured as follows, a bundle would be created (if one didn't exist) called <em><span style="color:#EF0E0E;">generalStrings</span></em>, then translations for resources in <span style="color:#1B1675;">German, French</span> and <span style="color:#1B1675;">English</span> would be imported.</p>
<pre>
translations.zip
|-<span style="color:#EF0E0E;">generalStrings</span>
....|-<span style="color:#1B1675;">de.po</span>
....|-<span style="color:#1B1675;">en.po</span>
....|-<span style="color:#1B1675;">fr.po</span>
</pre>
<p>If a single file is imported, the untranslated strings it contains are used to add entries for the default language of the application into which the file is imported.</p>

<h2>File Format</h2>
<p>Resources inside each PO file are parsed according to GNU's <a href="http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files">PO file format</a>.</p>
<p>PO files sometimes include an empty entry at the start of the file containing metadata. This entry is given the name <strong>Generator</strong> when importing, and is exported with no msgid when outputting to PO format. It is also possible to manually create this entry.</p>
<p>Each entry is structured as follows:</p>
<pre>
# translator comments
#. source code comments
#: ../../source/someapplication/locales/../src/interface/statuslinectrl.cpp:34
#: ../../source/someapplication/locales/../src/interface/statuslinectrl.cpp:97
msgctx "context info"
msgid "<span style="color:#8F4000;">Untranslated String</span>"
msgstr "<span style="color:#8F4000;">Translated String</span>"
</pre>


<h2>Plural Translations</h2>
<p>ResourceBlender does not support plural forms, so translations in the form <em>msgstr[N]</em> are split into new elements.
<p><strong>For example:</strong> When the following entry is parsed, an element will be created for <em>1 week</em> and <em>1 woche</em>, then another will be created for <em>%d weeks</em> and <em>%d wochen</em>.
<pre>
#: includes/common.inc:0
msgid "1 week"
msgid_plural "%d weeks"
msgstr[0] "1 woche"
msgstr[1] "%d wochen"
</pre>

<h2><a name="poedit">PO File Editor</a></h2>
<p>When editing an element, click the GNU icon to open the PO file editor. This allows entry data to be edited. Source comments, references and flags should be separated by a new line. The message context will be omitted if the <em>Context</em> field is left blank. To add an empty context, use an empty pair of quotes (<strong>""</strong>).</p>
<p>Comments, references and flags do not need to be prefixed by <em>#</em>,<em>#.</em> or <em>#,</em>, these will be added automatically.</p>
<img src="images/express-poedit.png" alt="PO file editor" class="centered />
<p><strong>Note:</strong> Only the source code comments, references and flags can be edited using the PO editor. Translators' comments are displays in the <em>Translator's Comment</em> field.</p>


</body>
</html>

